<template>
	<view :style="themeColor">
		<view class="page">
			<view class="benben-position-layout resultPayment_flex_0"
				:style="{height:(204+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class="flex flex-wrap align-center justify-between" style="height: 88rpx;width: 100%;">
					<view class='flex flex-wrap align-center resultPayment_fd0_0' @tap.stop="handleJumpDiy" data-type="back"
						data-url="1">
						<image class='resultPayment_fd0_0_c0' mode="aspectFit" :src='STATIC_URL+"234.png"'></image>
					</view>
					<text class='resultPayment_fd0_1'>我的邀请</text>
					<view class='flex flex-wrap align-center resultPayment_fd0_0'>
					</view>
				</view>
				<view class="input_view">
					<image :src='STATIC_URL+"183.png"' mode="aspectFill"></image>
					<input class="search_in" v-model="keyword" placeholder="请输入名字" placeholder-style="color:#999;font-size:28rpx;" confirm-type="search" type="text" maxlength="30" @confirm="getSearch">
				</view>
			</view>
			<view :style="{height: (204+StatusBarRpx)+'rpx'}"></view>
			
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#F35D2A"></u-loading>
				<view class="loading_text">加载中</view>
			</view>
			<template v-else>
				<view class="list">
					<view class="list_item" v-for="(item,index) in list" :key="index">
						<view class="item_img">
							<image :src='item.head_img' mode="aspectFill"></image>
						</view>
						<view class="item_content">
							<view class="item_name">{{item.user_nickname}}</view>
							<view class="item_date">
								{{item.create_time}}  注册
							</view>
						</view>
					</view>
				</view>
				<u-loadmore v-if="last_page > 1" style="padding: 24rpx 0;width: 100%;" :status="status"
					:icon-type="iconType" :load-text="loadText" />
				<view class="noData" v-if="list.length == 0 && !isShow">
					<image :src='STATIC_URL+"no.png"'></image>
				</view>
			</template>
			

		</view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"keyword": "",
				"list": [],
				"page": 1,
				"is_pull": true,
				"last_page": 1,
				"status": 'loadmore',
				"iconType": 'flower',
				"loadText": {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '我也是有底线的'
				},
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getList();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {
			this.page = 1;
			this.is_pull = true;
			this.isShow = true;
			this.getList()
		},
		onReachBottom(e) {
			if (this.page >= this.last_page) return;
			this.status = 'loading';
			this.page++;
			setTimeout(() => {
					
				if (this.page >= this.last_page) this.status = 'nomore';
				else this.status = 'loading';
				this.is_pull = false;
				this.getList();
			}, 500)
		},
		onPageScroll(e) {

		},
		methods: {
			getSearch() {
				this.page = 1;
				this.is_pull = true;
				this.isShow = true;
				this.getList()
			},
			getList() {
				this.$api.post(global.apiUrls.post65a8f5c5c9ae7, {
					page: this.page,
					keyword: this.keyword
				}).then(res => {
					// console.log(res);
					uni.stopPullDownRefresh();
					this.isShow = false;
					if (res.data.code == 1) {
						this.last_page = res.data.data.last_page;
						if (this.is_pull) {
							this.list = res.data.data.data;
						} else {
							this.list = this.list.concat(res.data.data.data);
						}
					} else {
						this.$message.info(res.data.msg);
					}
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.list {
		margin-top: 20rpx;
		padding: 0 32rpx;
		background: #fff;
		.list_item {
			padding: 32rpx 0;
			border-bottom: 1rpx solid #eee;
			display: flex;
			align-items: center;
			.item_img {
				width: 80rpx;
				height: 80rpx;
				image {
					width: 100%;
					height: 100%;
				}
			}
			.item_content {
				width: calc(100% - 104rpx);
				margin-left: 24rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;
				
				.item_name {
					font-size: 32rpx;
					color: #333;
				}
				.item_date {
					font-size: 28rpx;
					color: #666;
				}
			}
		}
	}
	.input_view {
		padding: 20rpx 32rpx 32rpx;
		position: relative;
		display: flex;
		image {
			width: 24rpx;
			height: 24rpx;
			position: absolute;
			top: 40rpx;
			left: 56rpx;
		}
		.search_in {
			width: 100%;
			height: 64rpx;
			background: #f9f9f9;
			border-radius: 34rpx;
			padding: 0 24rpx 0 64rpx;
		}
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background-size: 100% auto;
		background-color: #f8f8f8;
	}

	.resultPayment_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
		background-color: #fff;
	}

	.resultPayment_fd0_1 {
		color: #333;
		font-size: 36rpx;
		font-weight: 500;
	}

	.resultPayment_fd0_0_c0 {
		width: 20rpx;
		height: 36rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.resultPayment_fd0_0 {
		width: 100rpx;
		height: 88rpx;
	}

	.resultPayment_fd1_5 {
		background: #E3E3E3;
		border-radius: 36rpx 36rpx 36rpx 36rpx;
		font-size: 32rpx;
		color: rgba(51, 51, 51, 1);
		width: 280rpx;
		height: 72rpx;
		line-height: 72rpx;
		margin: 33rpx 0rpx 112rpx 0rpx;
	}

	.resultPayment_fd1_4 {
		background: #fff;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 28rpx;
		color: #F35D2A;
		width: 280rpx;
		height: 72rpx;
		line-height: 72rpx;
		margin-top: 88rpx;
		border: 1px solid #F35D2A;
	}

	.resultPayment_fd1_3 {
		margin: 16rpx 0rpx 87rpx 0rpx;
	}

	.resultPayment_fd1_2_c1 {
		color: #666666;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.resultPayment_fd1_2_c0 {
		color: #666666;
		font-size: 28rpx;
		font-weight: 400;
		line-height: 40rpx;
		padding: 0 110rpx;
		text-align: center;
	}

	.resultPayment_fd1_1 {
		color: #000000;
		font-size: 32rpx;
		font-weight: 500;
		line-height: 45rpx;
		margin: 40rpx 0rpx 30rpx 0rpx;
	}

	.resultPayment_fd1_0 {
		width: 250rpx;
		height: 180rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 88rpx 0rpx 0rpx 0rpx;
	}
</style>